/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gride.plugin;

import gride.events.EventManager;
import gride.gui.GUIManager;
import gride.project.ProjectManager;

/**
 *
 * @author lukasz
 */
public abstract class GridePlugin
{
    /**
     *
     */
    protected EventManager eventManager;
    /**
     *
     */
    protected ProjectManager projectManager;
    /**
     * 
     */
    protected GUIManager guiManager;

    private String name = "Gride Plugin";
    private String version = "0.0.1";
    private boolean activateOnStart = true;

    /**
     *
     */
    protected boolean active = false;


    /**
     *
     * @param eventManager
     */
    public void setEventManager(EventManager eventManager)
    {
        this.eventManager = eventManager;
    }

    /**
     *
     * @param projectManager
     */
    public void setProjectManager(ProjectManager projectManager)
    {
        this.projectManager = projectManager;
    }

    /**
     *
     * @param guiManager
     */
    public void setGUIManager(GUIManager guiManager)
    {
        this.guiManager = guiManager;
    }

    /**
     *
     * @return
     */
    public boolean isActive()
    {
        return active;
    }
    
    /**
     *
     * @return
     */
    public boolean getActivateOnStart()
    {
        return activateOnStart;
    }

    /**
     *
     * @param b
     */
    public void setActivateOnStart(boolean b)
    {
        activateOnStart = b;
    }

    /**
     *
     * @return
     */
    public String getName()
    {
        return name;
    }

    /**
     *
     * @param name
     */
    public void setName(String name)
    {
        this.name = name;
    }

    /**
     *
     * @return
     */
    public String getVersion()
    {
        return version;
    }

    /**
     *
     * @param version
     */
    public void setVersion(String version)
    {
        this.version = version;
    }

    @Override
    public String toString()
    {
        return name + " v" + version + (active ? " (ACTIVE)" : "");
    }


    /**
     *
     */
    public abstract void activate();

    /**
     *
     */
    public abstract void deactivate();
}
